Update library for Zig 0.16.0#46
Open
snorm-dev wants to merge 4 commits into
Open
Conversation
|
Can this be merged |
apotema
added a commit
to labelle-toolkit/labelle-assembler
that referenced
this pull request
May 26, 2026
Upstream bronter/wgpu_native_zig hasn't migrated to Zig 0.16 (last commit 2025-07, before 0.16 existed). snorm-dev/wgpu_native_zig PR #46 to bronter is open + clean + mergeable (opened 2026-05-23) but not yet reviewed by the maintainer. Pin directly to snorm-dev's branch SHA so our PR #228 can land. Repin to bronter/main once #46 merges. Was: apotema/wgpu_native_zig@fb54d9c8 (also pre-0.16) Now: snorm-dev/wgpu_native_zig@8aef4a98 (Zig 0.16 migration) Reference: bronter/wgpu_native_zig#46
apotema
added a commit
to labelle-toolkit/labelle-assembler
that referenced
this pull request
May 26, 2026
* chore(wgpu): build cleanly on Zig 0.16.0 (closes #220) Mirrors PR #218's sokol sweep for the wgpu backend: - `src/audio.zig:loadWav` + `src/gfx.zig:loadTexture` — swap `std.fs.cwd().openFile` for libc `fopen` / `fread` / `fclose` in the legacy path-based one-shot loaders. Zig 0.16 retired `std.fs.cwd()` in favour of `std.Io.Dir.cwd()` (requires an `Io` parameter threaded through). Production code goes through caller-provided byte buffers (`decodeImage`, `wav_parser.parseWav`) and never touches the FS, so threading `Io` through the whole backend for two legacy loaders is overkill. - `build.zig` — add `link_libc = true` on the `gfx` and `audio` modules so the libc swap links. These modules previously didn't link libc (no native deps), so this is a new opt-in. Switch `b.dependency("wgpu_native_zig", ...)` to `b.lazyDependency` since Zig 0.16 panics on `b.dependency` for a `lazy = true` dep. - `src/wav_parser.zig:202` — `std.ArrayList(u8) = .{}` -> `.empty`. Zig 0.16 drops the default-fields shape for the unmanaged ArrayList, requiring the named sentinel. This blocked `zig build test`. - `example/build.zig` — move `linkLibrary` / `linkSystemLibrary` / `addLibraryPath` from `*Build.Step.Compile` onto `exe.root_module` (0.16 moved those helpers onto `*Build.Module`). `linkSystemLibrary` on `*Module` now takes an extra options struct; passing `.{}`. - `build.zig.zon` (both) — `minimum_zig_version` 0.15.2 -> 0.16.0. Environmental blocker (called out in build.zig + PR body): upstream `apotema/wgpu_native_zig` @ fb54d9c8 is not yet Zig 0.16 compatible — its own build.zig calls `linkFramework` / `addLibraryPath` / `addObjectFile` on `*Compile`, which 0.16 moved onto `*Module`. Zig 0.16's build runner pre-compiles every transitive build.zig, so any `zig build` subcommand hits those upstream errors before our build function runs. Fixing that fork is a sibling-repo concern; this patch keeps the assembler-side surface 0.16-ready so the migration lands as soon as the fork catches up. Verification: - `zig ast-check` clean on all modified files. - `zig test src/wav_parser.zig` — 14/14 pass (regression lock for #12 still green). - `zig build-obj src/audio.zig -lc` — compiles clean (validates the libc swap in isolation). - `zig build` / `zig build test` blocked by the upstream `wgpu_native_zig` 0.16 incompatibility described above (not introduced here — present on origin/main too). - Example `zig build` not reached (same upstream block, plus Dawn prebuilt unavailable on this host). Scope: only `backends/wgpu/`. Does not touch sibling backends (each has its own ticket). * chore(wgpu): pin wgpu_native_zig to snorm-dev's Zig 0.16 PR branch Upstream bronter/wgpu_native_zig hasn't migrated to Zig 0.16 (last commit 2025-07, before 0.16 existed). snorm-dev/wgpu_native_zig PR #46 to bronter is open + clean + mergeable (opened 2026-05-23) but not yet reviewed by the maintainer. Pin directly to snorm-dev's branch SHA so our PR #228 can land. Repin to bronter/main once #46 merges. Was: apotema/wgpu_native_zig@fb54d9c8 (also pre-0.16) Now: snorm-dev/wgpu_native_zig@8aef4a98 (Zig 0.16 migration) Reference: bronter/wgpu_native_zig#46
apotema
added a commit
to labelle-toolkit/labelle-assembler
that referenced
this pull request
May 26, 2026
7 PRs since v0.34.1: - #225 fix(raylib): takeScreenshot handles absolute paths (closes #224) - #230 fix(raylib): replace rename trick with direct libc write (closes #229 — Linux EXDEV + Windows compile + Ubuntu X11) - #231 fix(sdl): SDL_DISABLE_ARM_NEON_H for Zig 0.16 arm_neon.h mismatch - #226 chore(backends): Zig 0.16 sweep on sdl + raylib + null (closes #221) - #227 chore(bgfx): build cleanly on Zig 0.16.0 + zbgfx pin bump (closes #219) - #228 chore(wgpu): build cleanly on Zig 0.16.0 + snorm-dev pin (closes #220, refs bronter/wgpu_native_zig#46) - #216 fix(codegen): sanitize plugin idents in resolve() emit (closes #212)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
build.zig, mostly using functions onCompile.root_modulecallconv(.C)->callconv(.c)Thread.sleep->std.Io.sleep; requires passing in astd.Iominimum_zig_version